<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>充值订单</title>
<link href="${base}/resources/admin/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/common.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/list.js"></script>
<script type="text/javascript">
$().ready(function() {

    var $listForm = $("#listForm");
    var $filterSelect = $("#filterSelect");
    var $filterOption = $("#filterOption a");

	[@flash_message /]
    $("#searchPropertyOption").children("li").find("a.current").trigger("click");

    // 订单筛选
    $filterSelect.mouseover(function() {
        var $this = $(this);
        var offset = $this.offset();
        var $menuWrap = $this.closest("div.menuWrap");
        var $popupMenu = $menuWrap.children("div.popupMenu");
        $popupMenu.css({left: offset.left, top: offset.top + $this.height() + 2}).show();
        $menuWrap.mouseleave(function() {
            $popupMenu.hide();
        });
    });

    // 筛选选项
    $filterOption.click(function() {
        var $this = $(this);
        var $dest = $("#" + $this.attr("name"));
        if ($this.hasClass("checked")) {
            $dest.val("");
        } else {
            $dest.val($this.attr("val"));
        }
        $listForm.submit();
        return false;
    });

});
</script>
</head>
<body>
	<form id="listForm" action="list" method="get">

        <input type="hidden" id="recharge_method" name="recharge_method" value="${recharge_method}" />
        <input type="hidden" id="trade_type" name="trade_type" value="${trade_type}" />
        <input type="hidden" id="status" name="status" value="${status}" />

		<div class="path">
			<a href="${base}/admin/index">${message("admin.path.index")}</a> &raquo; 充值 <span>(${message("admin.page.total", pager.total)})</span>

			<div class="menuWrap searchWrap">
				<div class="search">
					<span id="searchPropertySelect" class="arrow">选择字段 &nbsp;</span>
					<input type="text" id="searchValue" name="searchValue" value="${pager.pageable.searchValue}" maxlength="200" />
					<button type="submit">&nbsp;</button>
				</div>
				<div class="popupMenu">
					<ul id="searchPropertyOption">
                        <li>
                            <a href="javascript:;"[#if pager.pageable.searchProperty == "card_no"] class="current"[/#if] val="card_no">市民卡号</a>
                        </li>
						<li>
							<a href="javascript:;"[#if pager.pageable.searchProperty == "sn"] class="current"[/#if] val="sn">订单号</a>
						</li>
						<li>
							<a href="javascript:;"[#if pager.pageable.searchProperty == "trade_no"] class="current"[/#if] val="trade_no">流水号</a>
						</li>
						<li>
							<a href="javascript:;"[#if pager.pageable.searchProperty == "card_no"] class="current"[/#if] val="card_no">市民卡号</a>
						</li>
					</ul>
				</div>
			</div>
		</div>

		<div class="bar">

			<div class="buttonWrap">

				<a href="javascript:;" id="refreshButton" class="iconButton">
					<span class="refreshIcon">&nbsp;</span>${message("admin.common.refresh")}
				</a>

                <div class="menuWrap">
                    <a href="javascript:;" id="filterSelect" class="button">
                    ${message("admin.order.filter")}<span class="arrow">&nbsp;</span>
                    </a>
                    <div class="popupMenu">
                        <ul id="filterOption" class="check">
                            <li>
                                <a href="javascript:;" name="recharge_method" val="ALIPAY"[#if recharge_method == "ALIPAY"] class="checked"[/#if]>支付宝</a>
                            </li>
                            <li>
                                <a href="javascript:;" name="recharge_method" val="WECHAT"[#if recharge_method == "WECHAT"] class="checked"[/#if]>微信</a>
                            </li>
                            <li>
                                <a href="javascript:;" name="recharge_method" val="BALANCE_RECHARGE"[#if recharge_method == "BALANCE_RECHARGE"] class="checked"[/#if]>账户余额</a>
                            </li>
                            <li class="separator">
                                <a href="javascript:;" name="trade_type" val="01"[#if trade_type == "01"] class="checked"[/#if]>联机账户</a>
                            </li>
                            <li>
                                <a href="javascript:;" name="trade_type" val="02"[#if trade_type == "02"] class="checked"[/#if]>电子钱包</a>
                            </li>
                            <li class="separator">
                                <a href="javascript:;" name="status" val="0"[#if status == "0"] class="checked"[/#if]>未付款</a>
                            </li>
                            <li>
                                <a href="javascript:;" name="status" val="3"[#if status == "3"] class="checked"[/#if]>处理中</a>
                            </li>
                            <li>
                                <a href="javascript:;" name="status" val="4"[#if status == "4"] class="checked"[/#if]>撤销</a>
                            </li>
                            <li>
                                <a href="javascript:;" name="status" val="5"[#if status == "5"] class="checked"[/#if]>充值成功</a>
                            </li><li>
                                <a href="javascript:;" name="status" val="6"[#if status == "6"] class="checked"[/#if]>充值失败</a>
                            </li><li>
                                <a href="javascript:;" name="status" val="7"[#if status == "7"] class="checked"[/#if]>预充值成功</a>
                            </li><li>
                                <a href="javascript:;" name="status" val="8"[#if status == "8"] class="checked"[/#if]>补登成功</a>
                            </li>
                        </ul>
                    </div>
                </div>

				<div class="menuWrap">
					<a href="javascript:;" id="pageSizeSelect" class="button">
						${message("admin.page.pageSize")}<span class="arrow">&nbsp;</span>
					</a>
					<div class="popupMenu">
						<ul id="pageSizeOption">
							<li>
								<a href="javascript:;"[#if pager.pageable.pageSize == 10] class="current"[/#if] val="10">10</a>
							</li>
							<li>
								<a href="javascript:;"[#if pager.pageable.pageSize == 20] class="current"[/#if] val="20">20</a>
							</li>
							<li>
								<a href="javascript:;"[#if pager.pageable.pageSize == 50] class="current"[/#if] val="50">50</a>
							</li>
							<li>
								<a href="javascript:;"[#if pager.pageable.pageSize == 100] class="current"[/#if] val="100">100</a>
							</li>
						</ul>
					</div>
				</div>
			</div>

		</div>
		<table id="listTable" class="list">
			<tr>

				<th>
					<a>订单号</a>
				</th>
                <th>
                    <a>平台流水号</a>
                </th>
				<th>
					<a>市民卡号</a>
				</th>
				<th>
					<a>充值金额</a>
				</th>
				<th>
					<a href="javascript:;" class="sort" name="recharge_method">充值方式</a>
				</th>
				<th>
					<a href="javascript:;" class="sort" name="trade_type">交易类型</a>
				</th>
				<th>
					<a >状态</a>
				</th>
				<th>
					<a href="javascript:;" class="sort" name="create_date">创建日期</a>
				</th>

			</tr>
			[#list pager.content as recharge]
				<tr>

                    <td>
						${recharge.sn}
                    </td>
					<td>
						${recharge.trade_no}
					</td>
					<td>
						${recharge.card_no}
					</td>
					<td>
						${currency((recharge.amount?eval)/100, "true")}
					</td>
					<td>
						[#if recharge.recharge_method == 'WECHAT']
						    微信支付
						[#elseif recharge.recharge_method == 'ALIPAY']
						    支付宝
						[#else]
						    -
						[/#if]
					</td>
					<td>
						[#if recharge.trade_type == '01']
						    联机账户
						[#elseif recharge.trade_type == '02']
						    电子钱包
						[#else]
						    -
						[/#if]

					</td>
					<td>
                        [#if recharge.status == '0']
                            未付款
						[#elseif recharge.status == '3']
						    处理中
						[#elseif recharge.status == '4']
						    撤销
						[#elseif recharge.status == '5']
						    <span class="green">充值成功</span>
						[#elseif recharge.status == '6']
						    <span class="red">充值失败</span>
						[#elseif recharge.status == '7']
						    <span class="green">预充值成功</span>
                        [#elseif recharge.status == '8']
                            <span class="green">补登成功</span>
						[#else]
						    -
						[/#if]
					</td>
					<td>
						<span>${recharge.create_date?string("yyyy-MM-dd HH:mm:ss")}</span>
					</td>

				</tr>
			[/#list]
		</table>
		[#if (pager.content?size > 0)]
			[@pagination pageNumber = pager.pageable.pageNumber totalPages = pager.pageable.totalPages]
			[#include "/admin/include/pagination.html"]
			[/@pagination]
		[#else ]
		<div class="norecord">
			<span>没有记录!</span>
		</div>
		[/#if]

	</form>
</body>
</html>